<extend name="Public:innerbase" />
<block name="content">
<div class="page-topbar">
	<ol class="breadcrumb">
	  <li><a href="/User/Index/home.html">控制台</a></li>
	  <li><a href="/User/mall/plate.html">栏目管理</a></li>
	  <li class="active">栏目编辑</li>
	</ol>
</div>
<div class="container-fluid">
	<form action="" method="post" class="form-horizontal">
		<div class="form-group">
			<label for="title" class="control-label col-sm-2">栏目标题</label>
			<div class="col-sm-4">
				<input type="text" id="title" name="title" class="form-control" value="{$set.title}" />
			</div>
		</div>
		<div class="form-group">
			<label for="display_limit" class="control-label col-sm-2">显示数量</label>
			<div class="col-sm-4">
				<input type="text" id="display_limit" name="display_limit" class="form-control" value="{$set.display_limit}" />
				<span class="help-block">栏目中显示的产品数量</span>
			</div>
		</div>
		<div class="form-group">
			<label for="sort" class="control-label col-sm-2">排序</label>
			<div class="col-sm-4">
				<input type="text" id="sort" name="sort" class="form-control" value="{$set.sort|default=1}" />
				<div class="help-block">默认为 1,越大排序越靠前</div>
			</div>
		</div>
		<div class="form-group">
			<div class="col-sm-4 col-sm-offset-2">
				<div class="checkbox">
					<label>
					  <input name="is_show" value="1" <if condition="$set['is_show'] OR $set==null">checked</if> type="checkbox">显示
					</label>
				</div>
			</div>
		</div>
		<div class="form-group">
			<div class="col-sm-offset-2 col-sm-10">
			  <button type="submit" class="btn btn-success">保存</button>
			</div>
		</div>
	</form>
</div>
</block>
<block name="js">
<script type="text/javascript" src="{:STATICS}/js/jquery.form.js"></script>
<script src="{:STATICS}/pnotify/pnotify.custom.min.js"></script>
<script>
	$('.ajax-form').ajaxForm({
		success:function(data){
			if(data.status==1){
				new PNotify({
					text: data.info,
					type: 'success'
				});
				jump(2000);
			}
			else{
				new PNotify({
					text: data.info,
					type: 'error'
				});
			}
		}
	});
	
	function jump(delay){
		delay = delay || 3000;
		setTimeout("location.reload()",delay);
	}
</script>
</block>